package com.bjsxt.userCenter.back.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.bjsxt.userCenter.common.util.ConstantFinalUtil;
import com.bjsxt.userCenter.user.service.service.IUserService;

@Controller
@RequestMapping("/back/admins/")
public class AdminsBackController
{
	@Resource
	private IUserService userService;
	
	/**
	 * 登录后的首页
	 * @return
	 */
	@RequestMapping("/main")
	public String main()
	{
		ConstantFinalUtil.LOGGER.info("------main------");
		return "/back/main";
	}
	
	/**
	 * 左侧菜单切换
	 * @return
	 */
	@RequestMapping("/leftMenu")
	public String leftMenu()
	{
		ConstantFinalUtil.LOGGER.info("------leftMenu------");
		return "/back/leftMenu";
	}

	@RequestMapping("/logout")
	public String logout(HttpSession session)
	{
		ConstantFinalUtil.LOGGER.info("------logout------");
		session.removeAttribute("admins");
		session.removeAttribute("lastLoginTime");
		return "redirect:/login.htm";
	}
}
